package org.yangspring.samples.mvc.listeners;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.naming.event.EventContext;
import java.util.EventObject;

/**
 * Created by franklin on 6/27/2017.
 */

@Component
public class LisiListener implements ApplicationListener<ApplicationEvent> {

    private static final Logger logger = LoggerFactory.getLogger(LisiListener.class);

    @Override
    public void onApplicationEvent(final ApplicationEvent event) {
        if(event instanceof EventContext) {
            logger.warn("\nLi si Receive new message:\t" + event.getSource());
        }
    }
}
